<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div>
    <textarea id="content" cols="30" rows="10" placeholder="请输入文本内容"></textarea>
  </div>
  <div>
    <button id="save">保存</button>
  </div>
  <script>
    const content = document.getElementById('content')
    const save = document.getElementById('save')

    save.onclick = function () {
      if (!content.value) {
        alert('请输入内容')
      } else {
        preloadApi.save(content.value)
      }
    }
  </script>
</body>

</html>